
import { Line3d } from '../math/Line3d';
import BinaryLineTree from '../dataStruct/tree/binary-line-tree/BinaryLineTree';
import Entity from '../math/entity';
const bst = new BinaryLineTree();
export default function drawLine() {
  return new Entity({
    entity: new Line3d(),
    mousedown: function (loc) {
      this.$entity.setStartPt(loc);
    },
    mousemove: function (loc) {
      this.$entity.setEndPt(loc);
      this.$entity.render(false);
    },
    mouseup: function (loc) {
      this.$entity.setEndPt(loc);
      this.$entity.render(true);
      bst.insert(this.$entity);
    }
  });
  

}

